module.exports = function (grunt) {
  'use strict';

  require("load-grunt-tasks")(grunt);

  grunt.initConfig({

    sass: {
      development: {
        files: {
          "public/assets/css/signIn.css": "resources/assets/stylesheets/signIn.scss",
          "public/assets/css/font-awesome.css": "resources/assets/stylesheets/font-awesome.scss",
          "public/assets/css/loading.css": "resources/assets/stylesheets/loading.scss",
          "public/assets/css/backend.css": "resources/assets/stylesheets/backend.scss"
        }
      }
    },

    copy: {
      jquery: {
        expand: true,
        cwd: 'resources/assets/vendors/jquery/dist/',
        src: '**',
        dest: 'public/assets/js/',
        flatten: true,
        filter: 'isFile'
      },
      bootstrap: {
        expand: true,
        cwd: 'resources/assets/vendors/bootstrap-sass/assets/javascripts/',
        src: '*.min.js',
        dest: 'public/assets/js/',
        flatten: true,
        filter: 'isFile'
      },
      fontawesome: {
        expand: true,
        cwd: 'resources/assets/vendors/font-awesome/fonts/',
        src: '**',
        dest: 'public/assets/fonts/',
        flatten: true,
        filter: 'isFile'
      },
      entypo: {
        expand: true,
        cwd: 'resources/assets/vendors/entypo/font/',
        src: 'entypo.*',
        dest: 'public/assets/fonts/',
        flatten: true,
        filter: 'isFile'
      },
      opensans: {
        expand: true,
        cwd: 'resources/assets/vendors/open-sans/fonts/',
        src: '**',
        dest: 'public/assets/fonts/',
        flatten: false,
        filter: 'isFile'
      },
      pace: {
        expand: true,
        cwd: 'resources/assets/vendors/pace/',
        src: '*.min.js',
        dest: 'public/assets/vendors/pace/',
        flatten: true,
        filter: 'isFile'
      },
      animate: {
        expand: true,
        cwd: 'resources/assets/vendors/animate.css/',
        src: '*.min.css',
        dest: 'public/assets/css/',
        flatten: true,
        filter: 'isFile'
      },
      alertify: {
        expand: true,
        cwd: 'resources/assets/vendors/alertify/',
        src: '**',
        dest: 'public/assets/vendors/alertify/',
        flatten: false,
        filter: 'isFile'
      },
      slimScroll: {
        expand: true,
        cwd: 'resources/assets/vendors/slimScroll/',
        src: '*.min.js',
        dest: 'public/assets/vendors/slimScroll/',
        flatten: false,
        filter: 'isFile'
      },
      backstretch: {
        expand: true,
        cwd: 'resources/assets/vendors/jquery-backstretch/',
        src: '*.min.js',
        dest: 'public/assets/vendors/jquery-backstretch/',
        flatten: false,
        filter: 'isFile'
      },
      niceScroll: {
        expand: true,
        cwd: 'resources/assets/vendors/nicescroll/',
        src: '*.min.js',
        dest: 'public/assets/vendors/niceScroll/',
        flatten: false,
        filter: 'isFile'
      }
    },
    watch: {
      sass: {
        files: [
          "Gruntfile.js",
          "resources/assets/stylesheets/**/*.scss"
        ],
        tasks: ["sass"]
      }
    }
  });

  grunt.registerTask('default', [
    "watch"
  ]);

  grunt.registerTask('migrate', [
    "copy"
  ]);
};
